home *** CD-ROM | disk | FTP | other *** search
/ Amiga Inside! / Amiga FD Inside (1995)(Ultramax).iso / berndspd / devtools / intuigen / examples / editlisttest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-22  |  3.4 KB  |  227 lines

  1. #include <stddef.h>
  2. #include <stdlib.H>
  3. #include <stdio.H>
  4. #include <exec/exec.h>
  5. #include <intuition/intuition.h>
  6. #include <intuition/screens.h>
  7. #include <intuition/gadgetclass.h>
  8. #include <intuition/imageclass.h>
  9. #include <intuition/classusr.h>
  10. #include <intuition/icclass.h>
  11. #include <libraries/asl.h>
  12. #include <libraries/commodities.h>
  13. #include <rexx/storage.h>
  14. #include <rexx/simplerexx.h>
  15. #include <libraries/gadtools.h>
  16. #include <workbench/startup.h>
  17. #include <workbench/icon.h>
  18. #include <utility/tagitem.h>
  19. #include <clib/exec_protos.h>
  20. #include <clib/intuition_protos.h>
  21. #include <clib/alib_protos.h>
  22. #include <clib/asl_protos.h>
  23. #include <clib/commodities_protos.h>
  24. #include <clib/dos_protos.h>
  25. #include <clib/wb_protos.h>
  26. #include <clib/icon_protos.h>
  27. #include <clib/utility_protos.h>
  28. #include <IntuiGen/EditList.h>
  29.  
  30.  
  31. struct GTPKind {
  32.     UBYTE *Name;
  33.     struct Gadget * (*Create) (struct GTPKind *,struct Gadget *,struct GTControl *,struct GTRequest *,struct VisualInfo *);
  34.     void (*Destroy) (struct GTPKind *,struct GTControl *,struct GTRequest *);
  35. };
  36.  
  37. struct GTPKind LocalPKindList[] = {
  38.     { "EditList",CreateEditListKind,0 },
  39.     { 0,0,0 }
  40. };
  41.  
  42. struct TextAttr TextAttributes0 =
  43. {
  44.     "topaz.font",
  45.     TOPAZ_EIGHTY,
  46.     NULL,
  47.     FPF_ROMFONT
  48. };
  49.  
  50. struct TagItem QuitTags[]=
  51. {
  52.     {  GT_Underscore,'_'  },
  53.     {  TAG_DONE,0  }
  54. };
  55.  
  56. struct NewGadget NewQuit=
  57. {
  58.     216,182,
  59.     52,13,
  60.     (UBYTE *)"Quit",
  61.     &TextAttributes0,
  62.     0,
  63.     0,
  64.     0,
  65.     0
  66. };
  67.  
  68. struct MessageHandler QuitEndGadgetUp =
  69. {
  70.     NULL,
  71.     "EndGadgetUp",
  72.     NULL,
  73.     NULL
  74. };
  75.  
  76. struct GTControl Quit =
  77. {
  78.     NULL,
  79.     BUTTON_KIND,
  80.     INITFROMDATA | STOREDATA,
  81.     QuitTags,
  82.     NULL,
  83.     &NewQuit,
  84.     NULL,
  85.     &QuitEndGadgetUp,
  86.     '',
  87.     0,
  88.     0,
  89.     0,0,
  90.     NULL,
  91.     NULL,
  92.     NULL,
  93.     0,0,
  94.     0,
  95.     0,
  96.     NULL,
  97.     NULL,
  98.     NULL,
  99.     NULL,
  100.     NULL,
  101.     NULL,
  102.     NULL
  103. };
  104.  
  105. struct TagItem TestTags[] =
  106. {
  107.     {  GTPK_List, NULL  },
  108.     {  GTPK_Remember, 0  },
  109.     {  TAG_DONE, 0    }
  110. };
  111.  
  112. struct NewGadget NewTest =
  113. {
  114.     26,18,
  115.     195,153,
  116.     "",
  117.     &TextAttributes0,
  118.     0,
  119.     PLACETEXT_LEFT,
  120.     NULL,
  121.     NULL
  122. };
  123.  
  124. struct GTControl Test =
  125. {
  126.     &Quit,
  127.     "EditList",
  128.     INITFROMDATA | STOREDATA | GTC_PSEUDOKIND,
  129.     TestTags,
  130.     NULL,
  131.     &NewTest,
  132.     NULL,
  133.     NULL,
  134.     '',
  135.     0,
  136.     0,
  137.     0,0,
  138.     NULL,
  139.     NULL,
  140.     NULL,
  141.     0,0,
  142.     0,
  143.     0,
  144.     GTLV_Selected,
  145.     NULL,
  146.     NULL,
  147.     NULL,
  148.     NULL,
  149.     NULL,
  150.     NULL
  151. };
  152.  
  153. struct TagItem NewWindowTags[]=
  154. {
  155.     {  WA_Left, 21    },
  156.     {  WA_Top, 15  },
  157.     {  WA_InnerWidth, 304  },
  158.     {  WA_InnerHeight, 193    },
  159.     {  WA_IDCMP,
  160.         IDCMP_GADGETUP    },
  161.     {  WA_Title, "Test Edit"  },
  162.     {  WA_MinWidth, 310  },
  163.     {  WA_MinHeight, 206  },
  164.     {  WA_MaxWidth, 310  },
  165.     {  WA_MaxHeight, 206  },
  166.     {  WA_AutoAdjust, 1  },
  167.     {  WA_Flags,
  168.         WFLG_DRAGBAR | WFLG_DEPTHGADGET | WFLG_SMART_REFRESH | WFLG_ACTIVATE  }
  169. };
  170.  
  171.  
  172. struct GTMenuInfo ReqGTMenuInfo[] =
  173. {
  174.     { 0, 0 }
  175. };
  176.  
  177. struct GTRequest Req =
  178. {
  179.     NewWindowTags,
  180.     NULL,        /* Window */
  181.     NULL,            /* Menus */
  182.     ReqGTMenuInfo,        /* MenuInfo */
  183.     &Test,        /* Controls */
  184.     INITFROMDATA | STOREDATA,        /* Flags */
  185.     NULL,        /* RequestTags */
  186.     NULL,        /* Borders */
  187.     NULL,        /* Images */
  188.     NULL,        /* ITexts */
  189.     NULL,        /* InitFunc */
  190.     0,
  191.     NULL,
  192.     NULL,        /* DataStruct */
  193.     NULL,        /* EndFunction */
  194.     NULL,        /* LoopFunction */
  195.     0,0,        /* CallLoop, LoopBitsUsed */
  196.     0,0,        /* AdditionalSignals, SignalFunction */
  197.     NULL,        /* LocalMsgClassList */
  198.     LocalPKindList,       /* LocalPKindClassList */
  199.     NULL,        /* MsgHandlerList */
  200.     NULL,
  201.     NULL,
  202.     NULL,
  203.     NULL,
  204.     NULL,
  205.     NULL,
  206.     NULL,
  207.     NULL,
  208.     NULL
  209. };
  210.  
  211. main()
  212. {
  213.     struct Remember *key=0;
  214.     struct List l;
  215.  
  216.     TestTags[0].ti_Data=&l;
  217.     TestTags[1].ti_Data=&key;
  218.  
  219.     NewList(&l);
  220.  
  221.     GTRequest(&Req);
  222.  
  223.     FreeRemember(&key,1);
  224.     return 0;
  225. }
  226.  
  227.